home *** CD-ROM | disk | FTP | other *** search
- if(bricknumber == 1 and topSacre == false)
- {
- topSacre = true;
- now = new Date();
- depart_time = now.getTime();
- }
- if(bricknumber == 1 and topSacre == true)
- {
- now = new Date();
- arrivee_time = now.getTime();
- delta = arrivee_time - depart_time;
- if(4000 < delta)
- {
- sacrifice.gotoAndPlay(2);
- if(veut_sacrifier == true)
- {
- for(dent in "Structures")
- {
- var maDent = Structures[dent];
- if(typeof maDent == "movieclip")
- {
- if(maDent.vis == true)
- {
- sound.gotoAndPlay(2);
- bricknumber--;
- set("/:score",eval("/:score") + maDent.nbPoints);
- maDent.gotoAndPlay(2);
- sacrifice.gotoAndPlay(1);
- if(5 >= carries)
- {
- carries++;
- vies.nextFrame();
- }
- break;
- }
- }
- }
- }
- }
- }
- ballx += speedx;
- bally += speedy;
- for(dent in "Structures")
- {
- var maDent = Structures[dent];
- if(typeof maDent == "movieclip")
- {
- if(carrie.hitTest(maDent) and maDent.vis == true and topDent == false)
- {
- topDent = true;
- nomDent = maDent;
- maDent.nbHit--;
- if(maDent.nbHit == 0)
- {
- if(parseInt(Math.random() * 5) + 1 < 2 and topBonus == false)
- {
- tBonus = parseInt(Math.random() * 3) + 1;
- if(tBonus == 1)
- {
- duplicateMovieClip("bonusB","bonus",16385);
- }
- else if(tBonus == 2)
- {
- duplicateMovieClip("bonusV","bonus",16385);
- }
- else if(tBonus == 3)
- {
- duplicateMovieClip("bonusP","bonus",16385);
- }
- setProperty("bonus", _X, Math.random() * 470 + 150);
- setProperty("bonus", _Y, 10);
- topBonus = true;
- bonusy = bonus._y;
- }
- sound.gotoAndPlay(2);
- bricknumber--;
- set("/:score",eval("/:score") + maDent.nbPoints);
- maDent.gotoAndPlay(2);
- }
- else
- {
- sound.gotoAndPlay(2);
- }
- if(Math.abs(speedy) < Math.abs(speedx))
- {
- speedx = - speedx;
- ballx += speedx;
- }
- else
- {
- speedy = - speedy;
- bally += speedy;
- }
- break;
- }
- if(carrie.hitTest(maDent) == false and topDent == true and maDent == nomDent)
- {
- topDent = false;
- }
- }
- }
- if(topBonus == true)
- {
- bonusy += speedBonusy;
- if(lance_carries.hitTest(bonus))
- {
- if(tBonus == 3)
- {
- set("/:score",eval("/:score") + 350);
- sound.gotoAndPlay(65);
- chVitesse(vnor);
- setProperty("/lance_carries", _width, 54);
- }
- if(tBonus == 1)
- {
- set("/:score",eval("/:score") + 500);
- sound.gotoAndPlay(65);
- if(1 < carries)
- {
- carries--;
- vies.prevFrame();
- }
- }
- else if(tBonus == 2)
- {
- set("/:score",eval("/:score") + 200);
- sound.gotoAndPlay(65);
- chVitesse(vbon);
- }
- bonus.removeMovieClip();
- topBonus = false;
- }
- else if(404 >= bonusy)
- {
- setProperty("bonus", _Y, bonusy);
- }
- else
- {
- bonus.removeMovieClip();
- topBonus = false;
- }
- }
- if(topFluor != 0)
- {
- if(fluorman_x >= 620 - fluorwidth / 2 or 150 + fluorwidth / 2 >= fluorman_x)
- {
- fluorman_speedx = - fluorman_speedx;
- }
- if(fluorman_y >= 150 or 4 >= fluorman_y)
- {
- fluorman_speedy = - fluorman_speedy;
- }
- fluorman_x += fluorman_speedx;
- fluorman_y += fluorman_speedy;
- if(carrie.hitTest(Fluorman))
- {
- sound.gotoAndPlay(70);
- speedx = - speedx;
- speedy = - speedy;
- ballx += speedx;
- bally += speedy;
- if(topFluor == 1)
- {
- chVitesse(vflu);
- }
- else if(topFluor == 2)
- {
- chVitesse(vflu);
- }
- else if(topFluor == 3)
- {
- setProperty("/lance_carries", _width, 30);
- }
- }
- setProperty("Fluorman", _X, fluorman_x);
- setProperty("Fluorman", _Y, fluorman_y);
- }
- if(Number(ballx) >= Number(620 - ballwidth / 2) or Number(150 + Number(ballwidth / 2)) >= Number(ballx))
- {
- speedx = - speedx;
- ballx = Number(ballx) + Number(speedx);
- sound.gotoAndPlay(38);
- }
- if(Number(1 + Number(int(ballwidth / 2))) >= Number(bally))
- {
- sound.gotoAndPlay(38);
- speedy = - speedy;
- bally = Number(bally) + Number(speedy);
- }
- paddlex = getProperty("lance_carries", _X);
- if(404 < Number(bally) and Number(paddlex - paddlewidth / 2 - 8) < Number(ballx) and Number(ballx) < Number(Number(Number(paddlex) + Number(paddlewidth / 2)) + 8))
- {
- if(Number(ballx) < Number(Number(paddlex - paddlewidth / 2) + Number(int(paddlewidth / 5))))
- {
- speedx -= 6;
- }
- else if(Number(Number(paddlex) + Number(paddlewidth / 2) - int(paddlewidth / 5)) < Number(ballx))
- {
- speedx = Number(speedx) + 6;
- }
- else if(Number(ballx) < Number(Number(paddlex - paddlewidth / 2) + Number(int(paddlewidth / 3))))
- {
- speedx -= 3;
- }
- else if(Number(Number(paddlex) + Number(paddlewidth / 2) - int(paddlewidth / 3)) < Number(ballx))
- {
- speedx = Number(speedx) + 3;
- }
- speedy = - speedy;
- bally = Number(bally) + Number(speedy);
- sound.gotoAndPlay(21);
- }
- else if(404 < Number(bally))
- {
- if(Number(carries) < 5)
- {
- background.gotoAndPlay(2);
- }
- carries++;
- vies.nextFrame();
- chVitesse(vnor);
- speedy = - speedy;
- ballx = getProperty("/lance_carries", _X);
- bally = 400;
- setProperty("/lance_carries", _width, 54);
- if(topBonus)
- {
- bonus.removeMovieClip();
- topBonus = false;
- }
- gotoAndPlay(13);
- }
- setProperty("/carrie", _X, ballx);
- setProperty("/carrie", _Y, bally);
-